<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorate="~{portal/layout}">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="author" th:content="${#servletContext.getAttribute('paramMap')['author']}">
		<title th:text="${#servletContext.getAttribute('paramMap')['blogName']}">个人博客</title>
		<meta name="description" th:content="${#servletContext.getAttribute('paramMap')['description']}" />
		<meta name="keywords" th:content="${#servletContext.getAttribute('paramMap')['keywords']}" />
	</head>

	<body class="home blog custom-background round-avatars" >
		<div id="main" class="content" layout:fragment="content">
			<div class="container">
				<article itemscope="itemscope" th:if="${pageInfo.size > 0}">
					<div class="posts-list js-posts">
						<div class="post post-layout-list" data-aos="fade-up" th:each="post : ${pageInfo.list}">
							<div class="postnormal review leancloud_visitors" th:id="'/' + ${post.postUrl}">
								<div class="post-container review-item">
									<div class="row review-item-wrapper">
										<div class="col-sm-12 flex-xs-middle">
											<div class="review-item-title">
												<a th:href="@{'/' + ${post.postUrl}}"  rel="bookmark">[[${post.title}]]</a>
											</div>
											<div class="review-item-creator"><b>发布日期：</b>[[${#dates.format(post.createTime, 'yyyy-MM-dd')}]]</div>
											<span class="review-item-info" th:if="${#strings.isEmpty(#servletContext.getAttribute('paramMap')['leancloud_app_id']) eq false}"><b>总浏览量：</b><span class="leancloud-visitors-count"></span></span>
										</div>
									</div>
									<div class="review-bg-wrapper">
										<div th:if="${#strings.startsWith(post.imgUrl,'material')}">
											<div class="bg-blur" th:style="'background-image: url(/portal/images/random/'+${post.imgUrl}+');'"></div>
										</div>
										<div th:if="${#strings.startsWith(post.imgUrl,'material') eq false}">
											<div class="bg-blur" th:style="'background-image: url('+${post.imgUrl}+');'"></div>
										</div>
									</div>
								</div>
								<div class="post-container">
									<div class="entry-content">[[${post.subContent}]]</div>
									<div class="post-footer">
										<a class="gaz-btn primary" th:href="@{'/' + ${post.postUrl}}">阅读全文</a>
										<span class="total-comments-on-post pull-right"><a th:href="@{'/categories/'+ ${post.categoryName}+'/'}" style="color:#b7c6d7;"> [[${post.categoryName}]]</a></span>
									</div>
								</div>
							</div>
						</div>
					</div>
					<nav class="pagination js-pagination">
						<span th:if="${pageInfo.hasPreviousPage}">
							<a class="prev page-numbers" th:href="@{${pageInfo.pageNum-1} == 1 ? '/' : '/page/' + ${pageInfo.pageNum-1}+'/'}" ><strong>←</strong></a>
						</span>
						<span th:each="pageNum : ${pageInfo.navigatepageNums}">
							<span th:if="${pageNum == pageInfo.pageNum}">
								<a href="javascript:void(0)" th:text="${pageNum}" class="page-numbers current"></a>
							</span>
							<span th:if="${pageNum != pageInfo.pageNum}">
								<a th:href="@{${pageNum} == 1 ? '/' : '/page/' + ${pageNum}+'/'}" th:text="${pageNum}" class="page-numbers"></a>
							</span>
						</span>
						<span th:if="${pageInfo.hasNextPage}">
							<a class="next page-numbers" th:href="@{'/page/' + ${pageInfo.pageNum+1}+'/'}" ><strong>→</strong></a>
						</span>
					</nav>
				</article>
				<div th:if="${pageInfo.size == 0}" th:style="'text-align:center;'" th:text="'这个娑婆世界本来就不是享受的地方'"></div>
			</div>
			<div th:if="${#strings.isEmpty(#servletContext.getAttribute('paramMap')['leancloud_app_id']) eq false}">
				<script type='text/javascript' th:src="@{/portal/js/jquery.min.js}"></script>
				<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
				<script th:inline="javascript">
                    var appId = [[${#servletContext.getAttribute('paramMap')['leancloud_app_id']}]];
                    var appKey = [[${#servletContext.getAttribute('paramMap')['leancloud_app_key']}]]
                    AV.initialize(appId,appKey);
				</script>
				<script type='text/javascript' th:src="@{/portal/js/index.js}"></script>
			</div>
		</div>
	</body>

</html>